#ifndef PACKGE_HEADER_H
#define PACKGE_HEADER_H

#include "pcap.h"

typedef struct{
    u_char destination[6];
    u_char source[6];
    u_short type;
}eth_header;

typedef struct{
    u_char ver_len;
    u_char service_type;
    u_short totle_len;
    u_short identification;
    u_short flags_offset;
    u_char ttl;
    u_char proto;
    u_short checksum;
    u_char src_ip_addr[4];
    u_char des_ip_addr[4];
    u_int option_padding;
}ip_header;


typedef struct{
    u_short src_port;
    u_short des_port;
    u_short len;
    u_short checksum;
}udp_header;


typedef struct{
    u_short source_port;
    u_short dest_port;
    u_int seq;
    u_int ack;
    u_short flags;
    u_short window_size;
    u_short checksum;
    u_short urgent_pointer;
    u_int options;
}tcp_header;

typedef struct{
    u_char type;
    u_char code;
    u_short checksum;
    u_short identification;
    u_short seq;
}icmp_header;

typedef struct {
    u_short hardware_type;
    u_short proto_type;
    u_char mac_length;
    u_char ip_length;
    u_short op_code;

    u_char src_mac_addr[6];
    u_char src_ip_addr[4];
    u_char des_mac_addr[6];
    u_char des_ip_addr[4];

}arp_header;

typedef struct{
    u_short identification;
    u_short flags;
    u_short questions;
    u_short answer;
    u_short authority;
    u_short additional;
}dns_header;

typedef  struct{
    u_short query_type;
    u_short query_class;
}dns_question;

typedef  struct{
    u_short answer_type;
    u_short answer_class;
    u_int ttl;
    u_short data_len;
}dns_answer;

#endif // PACKGE_HEADER_H
